#!/usr/bin/env node

const Koa = require('koa'),
      logger = require('koa-logger');

const app = new Koa();

app.use(logger);
app.use(async (ctx,next)=>{ //M-logger
  console.log(`${ctx.method} ${ctx.path}`);
  await next();
});
//用来下载中间件
app.use((ctx,next)=>{  //M-hello
  ctx.body = 'hello world';
});
app.listen(8080);

console.log('hello world')

